<template>
	<view>
		<view class="np-list">
			<view class="np-item">
				<np-list-cell title="用户信息" :tips="userInfo.nickname" @eventClick="navTo('/pages/user/userinfo')"></np-list-cell>
			</view>
			<view class="np-item" v-if="userInfo.mobile != 0">
				<np-list-cell title="重置密码" @eventClick="navTo('/pages/user/setpassword')"></np-list-cell>
			</view>
			<view class="np-item">
				<np-list-cell title="当前版本 2.0.7" :leftIcon="false"></np-list-cell>
			</view>
		</view>
		<view class="np-logout" @click="clearUser">
			<text class="np-btn">退出登录</text>
		</view>
	</view>
</template>

<script>
	import base from '@/common/base.js';
	export default {
		mixins: [base],
		methods:{
			clearUser(){
				this.logout();
				uni.navigateBack();
			},
			navTo(url){
				uni.navigateTo({
					url: url
				});
			},
		}
	}
</script>

<style>
	.np-list{
		padding: 10rpx;
	}
	.np-item{
		background: #FFFFFF;
		border-radius: 10rpx;
		margin-bottom: 10rpx;
	}
	
	.np-logout{
		height: 100rpx;
		margin-top: 100rpx;
		display: flex;
		justify-content: center;
		align-items: center;
	}
	
	.np-btn {
		width: 400rpx;
		height: 88rpx;
		line-height: 88rpx;
		background-image: linear-gradient(45deg, #ff9700, #ed1c24);
		color: #fff;
		font-size: 36rpx;
		text-align: center;
		border-radius: 10rpx;
	}
</style>
